package com.kfm.dao.impl;

import com.kfm.dao.MoneyDao;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.jdbc.core.JdbcTemplate;
import org.springframework.stereotype.Repository;

@Repository
public class MoneyDaoImpl implements MoneyDao {

    @Autowired
    private JdbcTemplate jdbcTemplate;

    @Override
    public int updateMoney(Integer id, Double money) {
        String sql = "update money set money = money + ? where id = ?";
        return jdbcTemplate.update(sql, money, id);
    }
}
